package com.orange.score.model.user;

import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.orange.score.service.UserService;

public class UserManager
{
  public static final String USER_ID = "userId";
  private static SharedPreferences sharePreference;
  private static UserManager userManager = new UserManager();
  private UserService userService = new UserService();

  public static UserManager getInstance()
  {
    return userManager;
  }

  public void checkRegister()
  {
    String str = getUserId();
    if ((str == null) || (str.length() == 0))
      this.userService.RegisterUser();
  }

  public String getUserId()
  {
    return sharePreference.getString("userId", null);
  }

  public void saveUserId(String paramString)
  {
    sharePreference.edit().putString("userId", paramString).commit();
  }

  public void setSharePreference(SharedPreferences paramSharedPreferences)
  {
    sharePreference = paramSharedPreferences;
  }
}